package com.zsxj.xixi.dao;

import com.zsxj.xixi.common.utils.SQLUtils;
import com.zsxj.xixi.dao.base.BaseDao;
import com.zsxj.xixi.service.tag.TagVO;
import org.springframework.stereotype.Component;

import java.util.List;

import static com.zsxj.xixi.db.Tables.PREPARE_SKU_TAG;

/**
 * @Description
 * @Author mengweibin
 * @Date 2021-07-07 11:35
 */
@Component
public class TagDao extends BaseDao {


    public List<TagVO> queryTagByGoodsName(String spuName) {

        return dbNoMerchant.select(PREPARE_SKU_TAG.BARCODE)
                .from(PREPARE_SKU_TAG)
                .where(PREPARE_SKU_TAG.GOODS_NAME.like(SQLUtils.surroundingLike(spuName)))
                .fetchInto(TagVO.class);
    }
}
